package com.koo.modules.base.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.koo.common.utils.PageUtils;
import com.koo.common.utils.Query;
import com.koo.modules.base.dao.BaseDictItemDao;
import com.koo.modules.base.entity.BaseDictItemEntity;
import com.koo.modules.base.service.BaseDictItemService;
import org.springframework.stereotype.Service;

import java.util.Map;


@Service
public class BaseDictItemServiceImpl extends ServiceImpl<BaseDictItemDao, BaseDictItemEntity> implements BaseDictItemService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        LambdaQueryWrapper<BaseDictItemEntity> wrapper = new LambdaQueryWrapper<>();
        wrapper.orderByAsc(BaseDictItemEntity::getSort);
        IPage<BaseDictItemEntity> page = this.page(
                new Query<BaseDictItemEntity>().getPage(params), wrapper
        );
        return new PageUtils(page);
    }

}